<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fnt" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
%>
<% String[] ABCD={"A","B","C","D","E","F","G","H","I","G","K","L","M","N"};%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>错题练习页面</title>
    <link rel="stylesheet" href="<%=path%>/web/css/style2.css"/>
    <link rel="stylesheet" href="<%=path%>/web/css/style/style2.css" />
    <script src="<%=path%>/web/js/jq.js"></script>
    <script src="<%=path%>/web/js/jq1.js"></script>
</head>
<body>
<jsp:include page="headerandfoter/header.jsp"></jsp:include>
<br><br><br>
<!--内容开始-->
<div class="content" style="padding-bottom: 40px">
    <ul class="fl exam_sort">
        <li><img src="<%=path%>/user/picture/${sessionScope.loginUser.pic}" style="width:150px; height:150px; border-radius:100%; overflow:hidden;"></li><br><br>
        <li>姓名:${sessionScope.loginUser.userName}</li>
        <li>Email:${sessionScope.loginUser.email}</li>
        <li>错题数:${wrongTopics.size()}</li>
        <div class="clear"></div>
    </ul>
    <div class="subject">
        <div class="subject_con" id="xxxx">
            <h1>${num+1}、${wrongTopics.get(num).question.subject}(
                <c:if test="${wrongTopics.get(num).question.category.categoryName eq '单选题'}" >单选题</c:if>
                <c:if test="${wrongTopics.get(num).question.category.categoryName eq '多选题'}" >多选题</c:if>
                <c:if test="${wrongTopics.get(num).question.category.categoryName eq '判断题'}" >判断题</c:if>)
            </h1>
            <table width="272" border="0" cellspacing="0" cellpadding="0" class="selected">
                <c:forEach items="${wrongTopics.get(num).question.answers}" var="answers" varStatus="stat">
                    <tr>
                       <c:if test="${wrongTopics.get(num).question.category.categoryName eq '多选题'}" var="ass">
                           <td style="width: 60px">
                               <input class="daan1" name="abcd" type="checkbox"/>
                           </td>
                       </c:if>
                        <c:if test="${not ass}"><td style="width: 60px">
                            <input class="daan1" name="abcd" type="radio"></td>
                        </c:if>
                        <td>${answers.answerContent}</td>
                    </tr>
                </c:forEach>
            </table>
            <div class="clear"></div>
            <div class="anwsercon" style="display:none;" >
                <p style="color:#f00;">正确答案为:
                    <c:forEach items="${wrongTopics.get(num).question.answers}" var="answer" varStatus="stat">
                        <c:if test="${answer.trueAnswer ne '1'}">
                            ${answer.answerContent}
                        </c:if>
                    </c:forEach></p>
                <p class="xiangjie">详解：
                    <span class="jiecon" >${wrongTopics.get(num).question.explain}</span>
                </p>
            </div>
        </div>
        <div class="anwsercard">
            <ul class="anwser">
                <c:forEach begin="1" end="${wrongCount}" var="i">
                    <li>
                        <a href="#" data-id="${i}" class="datika">${i}</a>
                    </li>
                </c:forEach>
                <div class="clear"></div>
            </ul>
            <div class="clear"></div>
        </div>
    </div>
    <div class="collection">
        <ul>
            <li class="subject_a up" id="upq"><a href="#"></a></li>
            <li class="subject_a down" id="downq"><a href="#"></a></li>
            <li  class="collectbg"><a href="#" class="card" style="padding-left: 30px">展开答题卡</a></li>
        </ul>
    </div>
</div>
<!--内容结束-->
<!--尾部开始-->
<jsp:include page="headerandfoter/foter.jsp"></jsp:include><!-- 包含尾部 -->
<!--尾部结束-->
<script type="text/javascript" src="<%=path%>/web/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path%>/web/js/define.js"></script>

<script>
    $(function(){
        var divv=$("#xxxx");
        $("#downq").click(function(){
            $.ajax({
                url:"/services/xiayitiw",
                async:false,
                success:function(html){
                    console.log(html);
                    $("div.subject").html(html);
                }
            });
        });
    })
    $(function(){
        var divv=$("#xxxx");
        $("#upq").click(function(){
            $.ajax({
                url:"/services/shangyitiw",

                async:false,
                success:function(html){
                    console.log(html);
                    $("div.subject").html(html);
                }
            });
        });

       // 答题卡
        $("body").on("click",".datika",function () {
            var count=$(this).data("id");
            console.log(count);
            $.ajax({
                url:"/services/answers-paper",
                data:{count:count},
                type:"post",
                async:false,
                success:function (html) {
                    console.log(html)
                    $(".subject").html(html);
                }
            });
        })
    })

</script>
</body>
</html>
